import React, { Component, lazy, Suspense } from 'react';
import Tabber from '../../components/Tabber/Index'
import './Index.scss'
import { Route, Redirect, Switch } from 'react-router-dom';
import RouterView from '../../router/RouterView';
import routes from '../../router/routeConfig'
// let Home = lazy(() => import('./Home'))
// let Cate = lazy(() => import('./Cate'))
// let Shopcart = lazy(() => import('./Shopcart'))
// let Mine = lazy(() => import('./Mine'))
// let NotFound = lazy(() => import('../NotFound'))

class Index extends Component<any> {
    render() {
        return (
            <div className='index'>

                {/*  */}
                <RouterView routes={this.props.routes}/>
                <>
                    {/* <Suspense>
                    <Switch>
                        <Route path='/index/home' component={Home} />
                        <Route exact path='/index/cate' component={Cate} />
                        <Route exact path='/index/shopcart' component={Shopcart} />
                        <Route exact path='/index/mine' component={Mine} />
                        <Redirect exact from='/index' to='/index/home' />
                        
                        <Route path='*' component={NotFound} />
                    </Switch>
                </Suspense> */}
                </>

                {/* 渲染 Tabber 组件 */}
                <Tabber />

            </div>
        );
    }
}

export default Index;